<template>
    <div class="maxBox">
        <div>
        <p>{{articalTitle}}</p>
        <input type="text" v-model="articalTitle" placeholder="文章标题">
        <input type="text" v-model="articalDescription" placeholder="文章标签">
        <input type="text" v-model="draftContent" placeholder="草稿详细">
        <input type="button" @click="add" value="添加">
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            articalTitle:'',
            articalDescription:'',
            draftContent:'',
            mydate:''
        }
    },
    methods:{
        add(){
            var date=new Date();
            this.mydate=date.getFullYear()+"/"+date.getMonth()+"/"+date.getDate()+"-"+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
            
            this.$axios.get("/api/myBlog/addDr",{
                params:{
                    username:sessionStorage.getItem("username"),
                    title:this.articalTitle,
                    description:this.articalDescription,
                    date:this.mydate,
                    draftContent:this.draftContent
                }
            })
            this.$router.push("/myBlog/draftBox")
        }
    }
}
</script>
<style scoped>
.maxBox{
    display: flex;
    justify-content: center;
    align-items: center;
}
.maxBox p{
    font-size: 30px;
    color:white;
    text-align: center;
}
.maxBox input{
    width: 300px;
    height: 50px;
    border:none;
    display: block;
    background-color: transparent;
    border-bottom: 2px solid aqua;
    margin-top:50px;
    color:white;
}
.maxBox input[type=button]{
    width: 300px;
    height: 50px;
    border:none;
    display: block;
    background-color: aqua;
    margin-top:50px;
    color:white;
}
</style>